<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<jsp:include page="../../inc.jsp"></jsp:include>
<title>公告总表</title>
</head>
<body>
	<table id="table">
	</table>
	<script type="text/javascript">
	$('#table').datagrid({
		url:'${ctx}/notice/all',
		singleSelect:true,
		fit:true,
		toolbar: '.tools',
		striped:true,
		pagination:false,
		rownumbers:true,
		nowrap:false,
		columns:[[
			{field:'title',title:'标题',width:"65%",align:"center",
				formatter:function(value,row,index){ 
					var test = 1;
					var d ='<span class="title_list"><a href="#" onclick="clickrow('+row.id+')" style="text-decoration:none;">'+value+'</a></span>'; 
					if(row.isNew<=7){
						d = d + '<span class="new"></span>';
					}
					return d; 
				}
			},
			{field:'date',title:'发布时间',width:"30%",align:"center"}
			
		]]
	});
		
		
	function clickrow(id){
		$('#dl').dialog({  
			iconCls:'icon-search',
			title: null,
			resizable:true,
			fit:true,  
			closed: false,   
			cache: false,   
			//content:'<iframe scrolling="auto" frameborder="0" src="${ctx}/notice/'+id+'" height="99%" width="100%"></iframe>',
			href: '${ctx}/notice/'+id,   
			modal: true ,
			buttons:[{
				text: '关&nbsp;&nbsp;闭',
				handler: function () {
					$('#dl').dialog('close');
				}
			}]
		});    
	
	}
	function datareload(){
		$('#dl').datagrid('reload');  
	}		
	</script>
	<div id="dl"></div>
</body>
</html>
